<template>
	<view class="custom_box">
		<view class="custom_img_box">
			<image src="/static/custom/img-wxcode.png" mode="" class="custom_img" :show-menu-by-longpress="true"
				@click="handleSaveImg"></image>
		</view>
		<view class="custom_title">
			<p>点击或扫描二维码</p>
			<p>保存图片添加客服微信</p>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				url: ''
			}
		},
		onLoad() {

		},
		methods: {
			// 点击保存
			async handleSaveImg() {
				await ks.saveImageToPhotosAlbum({
					filePath: '/static/custom/img-wxcode.png',
					success: res => {
						console.log('保存成功', res)
					},
					fail: err => {
						console.log('保存失败', err)
					}
				});

			}
		}
	}
</script>

<style lang="scss" scoped>
	.custom_box {
		position: absolute;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);

		.custom_img_box {

			.custom_img {
				width: 400rpx;
				height: 400rpx;
			}
		}

		.custom_title {
			font-size: 24rpx;
			color: #999;
			text-align: center;
			padding-top: 50rpx;
		}
	}
</style>